package jannex.sql.extensions;

import jannex.Jannex;
import jannex.internal.ExceptionFactory;
import jannex.sql.JxSavepoint;

import java.sql.SQLException;
import java.sql.Savepoint;

public class SavepointImpl implements JxSavepoint {

    private Savepoint savepoint;
    private Jannex jannex;

    public SavepointImpl(Savepoint savepoint, Jannex jannex) {
        this.savepoint = savepoint;
        this.jannex = jannex;
    }

    @Override
    public int getSavepointId() {
        try {
            return savepoint.getSavepointId();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }

    @Override
    public String getSavepointName() {
        try {
            return savepoint.getSavepointName();
        } catch (SQLException e) {
            throw ExceptionFactory.make(e);
        }
    }
}
